package tmproject.hlhj.fhp.tmvote.customView

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import android.widget.RelativeLayout
import tmproject.hlhj.fhp.tmvote.log

/**
 * Created by Never Fear   on 2018\8\17 0017.
Never More....
 */
class MyRelaytive:RelativeLayout {
    constructor(context: Context?) : super(context)
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)


    override fun onTouchEvent(event: MotionEvent?): Boolean {
        log("fhpp","OnTouch里面${event?.action}事件消耗了吗？${super.onTouchEvent(event)}")
        return super.onTouchEvent(event)
    }

    override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
        log("fhpp","点击事件${ev?.action}事件拦截了吗？${super.onInterceptTouchEvent(ev)}")
//        return super.onInterceptTouchEvent(ev)
        if (ev?.action==MotionEvent.ACTION_MOVE){
            return true
        }else{
            return true
        }
    }
}